package com.entity;

import com.annotation.ColumnInfo;

import javax.validation.constraints.*;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;

import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;


/**
 * 课程信息
 *
 * @author
 * @email
 */
@TableName("kecheng")
public class KechengEntity<T> implements Serializable {
    private static final long serialVersionUID = 1L;


    public KechengEntity() {

    }

    public KechengEntity(T t) {
        try {
            BeanUtils.copyProperties(this, t);
        } catch (IllegalAccessException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }


    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ColumnInfo(comment = "主键", type = "int(11)")
    @TableField(value = "id")

    private Integer id;


    /**
     * 课程标题
     */
    @ColumnInfo(comment = "课程标题", type = "varchar(200)")
    @TableField(value = "kecheng_name")

    private String kechengName;


    /**
     * 课程照片
     */
    @ColumnInfo(comment = "课程照片", type = "varchar(200)")
    @TableField(value = "kecheng_photo")

    private String kechengPhoto;


    /**
     * 课程类型
     */
    @ColumnInfo(comment = "课程类型", type = "int(11)")
    @TableField(value = "kecheng_types")

    private Integer kechengTypes;

    public Integer getSign() {
        return sign;
    }

    public void setSign(Integer sign) {
        if (sign == null) this.sign = 0;
        else
            this.sign = sign;
    }

    @ColumnInfo(comment = "签到", type = "int(11)")
    @TableField(value = "sign")

    private Integer sign;
    /**
     * 课程时长
     */
    @ColumnInfo(comment = "课程时长", type = "int(11)")
    @TableField(value = "kecheng_shichang")

    private Integer kechengShichang;


    /**
     * 开始时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @ColumnInfo(comment = "开始时间", type = "timestamp")
    @TableField(value = "kecheng_time")

    private Date kechengTime;


    /**
     * 班级
     */
    @ColumnInfo(comment = "班级", type = "int(11)")
    @TableField(value = "banji_types")

    private Integer banjiTypes;


    /**
     * 教师
     */
    @ColumnInfo(comment = "教师", type = "int(11)")
    @TableField(value = "jiaoshi_id")

    private Integer jiaoshiId;


    /**
     * 逻辑删除
     */
    @ColumnInfo(comment = "逻辑删除", type = "int(11)")
    @TableField(value = "kecheng_delete")

    private Integer kechengDelete;


    /**
     * 课程详情
     */
    @ColumnInfo(comment = "课程详情", type = "text")
    @TableField(value = "kecheng_content")

    private String kechengContent;


    /**
     * 创建时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @ColumnInfo(comment = "创建时间", type = "timestamp")
    @TableField(value = "create_time", fill = FieldFill.INSERT)

    private Date createTime;


    /**
     * 获取：主键
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置：主键
     */

    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取：课程标题
     */
    public String getKechengName() {
        return kechengName;
    }

    /**
     * 设置：课程标题
     */

    public void setKechengName(String kechengName) {
        this.kechengName = kechengName;
    }

    /**
     * 获取：课程照片
     */
    public String getKechengPhoto() {
        return kechengPhoto;
    }

    /**
     * 设置：课程照片
     */

    public void setKechengPhoto(String kechengPhoto) {
        this.kechengPhoto = kechengPhoto;
    }

    /**
     * 获取：课程类型
     */
    public Integer getKechengTypes() {
        return kechengTypes;
    }

    /**
     * 设置：课程类型
     */

    public void setKechengTypes(Integer kechengTypes) {
        this.kechengTypes = kechengTypes;
    }

    /**
     * 获取：课程时长
     */
    public Integer getKechengShichang() {
        return kechengShichang;
    }

    /**
     * 设置：课程时长
     */

    public void setKechengShichang(Integer kechengShichang) {
        this.kechengShichang = kechengShichang;
    }

    /**
     * 获取：开始时间
     */
    public Date getKechengTime() {
        return kechengTime;
    }

    /**
     * 设置：开始时间
     */

    public void setKechengTime(Date kechengTime) {
        this.kechengTime = kechengTime;
    }

    /**
     * 获取：班级
     */
    public Integer getBanjiTypes() {
        return banjiTypes;
    }

    /**
     * 设置：班级
     */

    public void setBanjiTypes(Integer banjiTypes) {
        this.banjiTypes = banjiTypes;
    }

    /**
     * 获取：教师
     */
    public Integer getJiaoshiId() {
        return jiaoshiId;
    }

    /**
     * 设置：教师
     */

    public void setJiaoshiId(Integer jiaoshiId) {
        this.jiaoshiId = jiaoshiId;
    }

    /**
     * 获取：逻辑删除
     */
    public Integer getKechengDelete() {
        return kechengDelete;
    }

    /**
     * 设置：逻辑删除
     */

    public void setKechengDelete(Integer kechengDelete) {
        this.kechengDelete = kechengDelete;
    }

    /**
     * 获取：课程详情
     */
    public String getKechengContent() {
        return kechengContent;
    }

    /**
     * 设置：课程详情
     */

    public void setKechengContent(String kechengContent) {
        this.kechengContent = kechengContent;
    }

    /**
     * 获取：创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置：创建时间
     */

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Kecheng{" +
                ", id=" + id +
                ", kechengName=" + kechengName +
                ", kechengPhoto=" + kechengPhoto +
                ", kechengTypes=" + kechengTypes +
                ", kechengShichang=" + kechengShichang +
                ", kechengTime=" + DateUtil.convertString(kechengTime, "yyyy-MM-dd") +
                ", banjiTypes=" + banjiTypes +
                ", jiaoshiId=" + jiaoshiId +
                ", kechengDelete=" + kechengDelete +
                ", kechengContent=" + kechengContent +
                ", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
                "}";
    }
}
